package com.xunfang.service;

import com.xunfang.bean.Emp;
import com.xunfang.dao.EmpDaoimpt;

import java.util.List;

public class EmpServiceImpt implements EmpService{
    EmpDaoimpt empdao = new EmpDaoimpt();

    @Override
    public boolean delEmpAndDeptByDeptno(int deptno) throws Exception {
        int i = empdao.deleteempEmp(deptno);
        int j = empdao.deleteDetEmp(deptno);
        if(i>0 && j>0){
            return true;
        }
        return false;
    }

    @Override
    public List<Emp> selectEmp(String name, String job, Double sal) throws Exception {
        List<Emp> list = empdao.selectEmp(name, job, sal);
        return list;
    }

    public List<Emp> moveselect(String ename, String jpb, Double sal) throws Exception{
        EmpDaoimpt edao = new EmpDaoimpt();
        List<Emp> list = edao.moveselect(ename, jpb, sal);
        return list;
    }
}